<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>操作元素的属性</title>
</head>
<body>
<input type="text" id="testId">
<input type="button" value="点击" id="btn">
</body>
<script type="text/javascript">
    var btn = document.getElementById("btn");
    btn.onclick = function () {
        //获取id为testId元素的id属性
        var testId = document.getElementById("testId");
        //console.log(testId.value)
        //testId.value = "hello";
        testId.type = "button";

    };
</script>
</html>